﻿@{
    ViewBag.Title = "图文消息管理";
}
@section css
{
    <link href="/Content/css/imageText/main.css" rel="stylesheet" />
}

<div class="low" id="col0">
    <div class="sc_box box_radius">
        <p>
            <a href="/Wechat/EditImageText">
                <img src="/Content/images/wechat/ico01.png" />
                <br />单图文上传
            </a>
            <a href="/Wechat/EditImageTextGroup">
                <img src="/Content/images/wechat/ico02.png" />
                <br />多图文上传
            </a>
        </p>
    </div>
</div>
<!--low 01 -->

<div class="low" id="col1">

</div>

<!--low 02 -->

<div class="low" id="col2"></div>
@section scripts
{
    <script>
        $(document).ready(function () {
            var url = "/Wechat/WechatMemuAjax?sub=getImageTextList"
            $.post(url,
                function (datas) {
                    var data = JSON.parse(datas)
                    var col = 1;
                    if (data.status) {
                        for (var i = 0; i < data.data.length; i++) {
                            var item = data.data[i];
                            var colHtml = new Array();
                            colHtml.push("<div class=\"ct_box box_radius\">")
                            colHtml.push("<div class=\"ct_box_nav\">")
                            colHtml.push("<h3>" + item.banner.title + "</h3>")
                            colHtml.push("<h4>" + item.createDate + "</h4>")
                            colHtml.push("</div>")
                            colHtml.push("<div class=\"ct_banner\">")
                            colHtml.push("<a href=\"javascript:void(0)\">")
                            colHtml.push("<p>" + item.banner.title + "</p>")
                            colHtml.push("<img src=\"" + item.banner.picUrl + "\"/>")
                            colHtml.push("</a>")
                            colHtml.push("  </div>")
                            if (item.type == 0) {
                                colHtml.push("<div class=\"ct_text\">" + item.banner.title + "</div>")
                            } else {
                                colHtml.push("<div class=\"ct_duo\">")
                                for (var j = 0; j < item.list.length; j++) {
                                    var child = item.list[j]
                                    colHtml.push("<dl>")
                                    colHtml.push("<a href=\"javascript:void(0)\">")
                                    colHtml.push("<dt>" + child.title + "</dt>")
                                    colHtml.push("<dd>")
                                    colHtml.push("<img src=\"" + child.picUrl + "\"/>    ")
                                    colHtml.push("</dd>")
                                    colHtml.push("<div class=\"clear\"></div>")
                                    colHtml.push("</a>")
                                    colHtml.push("</dl>")
                                }

                                colHtml.push("<div class=\"clear\"></div>")
                                colHtml.push("</div>")
                            }

                            colHtml.push("<div class=\"ct_xg\">")
                            colHtml.push("<a href=\"")
                            if (item.type == 0) {
                                colHtml.push("/Wechat/EditImageText?imageTextId=" + item.id);
                            }
                            else {
                                colHtml.push("/Wechat/editImageTextGroup?groupid=" + item.groupId);
                            }
                            colHtml.push("\">")
                            colHtml.push("<img src=\"/Content/images/wechat/ico05.png\"/>")
                            colHtml.push("</a>")
                            colHtml.push("<a href=\"javascript:void(0)\" onclick=\"DelImageTextOrGroup(0,7,this)\" style=\"border:none;\">")
                            colHtml.push("<img src=\"/Content/images/wechat/ico04.png\"/>")
                            colHtml.push("</a>")
                            colHtml.push("<div class=\"clear\"></div>")
                            colHtml.push("</div>")
                            colHtml.push("<div class=\"clear\"></div>")
                            colHtml.push(" </div>")
                            col = col % 3
                            $("#col" + col).append(colHtml.join(''))
                            col++;
                        }
                    } else {
                        layer.msg(data.message);
                    }
                }, "json")
        })
    </script>
}
